#ifndef __FILEHANDLER_H__
#define __FILEHANDLER_H__

#include <IHandler.h>
#include <LogRecord.h>

#include <fstream>
#include <string>

namespace logging
{
class FileHandler : public IHandler
    {
    public:
	bool		open( const std::string & fileName, bool append = false );

	void 		close();
	void 		flush();
	    
	LogLevel 	logLevel() const;
	void 		setLogLevel( LogLevel logLevel );

	void 		processRecord( const LogRecord & record );

	bool 		ready();

    protected:
	std::ofstream 	m_stream;
	LogLevel 	m_logLevel;
    };
}	
#endif // __FILEHANDLER_H__
